<?php
  // Display all header alerts via messageStack:
  if ($messageStack->size('header') > 0) {
    echo $messageStack->output('header');
  }
  if (isset($_GET['error_message']) && zen_not_null($_GET['error_message'])) {
    echo htmlspecialchars(urldecode($_GET['error_message']));
  }
  if (isset($_GET['info_message']) && zen_not_null($_GET['info_message'])) {
    echo htmlspecialchars($_GET['info_message']);
  } else {
  }

// test if box should display
  $show_languages= true;

  if ($show_languages == true) {
    if (!isset($lng) || (isset($lng) && !is_object($lng))) {
      $lng = new language;
    }

    reset($lng->catalog_languages);
    $languages_array = array();
    $current_language = '';    
      while (list($key, $value) = each($lng->catalog_languages)) {
        $languages_array_popup[$key] = $value['name'];
      }
     
    foreach ($languages_array_popup as $k => $v){
        if ($k == $_SESSION['languages_code']) {
            $current_language = $v;
        }
    }
  }

?>
<!--bof-header logo and navigation display-->
<?php
if (!isset($flag_disable_header) || !$flag_disable_header) {
?>

<div class="m-logo">
<?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . 
	zen_image($template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO_IMAGE, HEADER_ALT_TEXT) . '</a>';?>
</div>
<!--search-->
<div class="search-header">
	<?php require($template->get_template_dir('tpl_search_header.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_search_header.php');?>
</div>
<!--/search-->
<div class="m-navbar">
<ul class="nm">
	<li class="nd nd-nodrop"><!--login-->
<?php if ($_SESSION['customer_id']) { ?>
<?php echo(TOP_MENU_HELLO);?><a class="mark-login hv s-fc2" href="<?php echo zen_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>">
<?php echo ($_SESSION['customer_first_name'].' '.$_SESSION['customer_last_name']);?></a>
 <span class="seprator">|</span>
 <a class="mark-login hv s-fc2" href="<?php echo zen_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>">
<?php echo HEADER_TITLE_LOGOFF; ?></a>
<?php
   } else {
   		if (STORE_STATUS == '0') {
   ?>
<?php echo LOGIN_WELCOME; ?>
  <a class="mark-login hv s-fc2" href="<?php echo zen_href_link(FILENAME_LOGIN, '', 'SSL'); ?>">
  <?php echo HEADER_TITLE_LOGIN; ?></a> <span>&nbsp;or&nbsp;</span>
   <?php echo REGISTER_WELCOME; ?>
  <span><a class="mark-login hv s-fc2" href="<?php echo zen_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'); ?>">
  <?php echo HEADER_TITLE_REGISTER; ?></a></span>
  <?php } } ?>
  <span class="seprator">|</span>
<!--/login--></li>

	<li class="nd nd-1 nd-nodrop"><a class="hv s-fc2" href="<?php echo zen_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>">
   <?php echo TOP_MENU_MY_ACCOUNT;?>
   </a>
   <span class="seprator">|</span>
   </li>
	<li class="nd nd-1 nd-nodrop"><a class="hv s-fc2" target="_blank" href="#">帮助</a></li>
</ul>	
</div>
<?php } ?>
<!--eof-header logo and navigation display-->
